package com.flame.shapeville.component.task1.shape2D;

import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.Shape;

/**
 * Represents a rectangle shape used in Task 1.
 * <p>
 * This class renders a rectangle with fixed aspect ratio (3:5).
 *
 * @author Flame Dev Team
 * @version 1.0
 * @since 2025-05-12
 */
public class JfRectangle extends JfShape2D {
    /**
     * Internal rectangle object used for rendering.
     */
    private Rectangle rectangle;

    /**
     * Dimension parameter used for positioning and scaling.
     */
    private double shape;

    /**
     * Constructs a new rectangle with the specified size.
     *
     * @param shape the width of the rectangle
     */
    public JfRectangle(double shape) {
        this.shape = shape;
        rectangle = new Rectangle(0, 0, shape, shape / 5 * 3);
        rectangle.setFill(Color.CYAN);
        rectangle.setStroke(Color.BLACK);
        rectangle.setStrokeWidth(2);
    }

    /**
     * Gets the visual representation of this shape.
     *
     * @return the JavaFX Shape object representing the rectangle
     */
    @Override
    public Shape getShape() {
        return rectangle;
    }
}
